package com.hyb.algorithm.data.struct.thread;

import java.util.concurrent.CompletableFuture;

/**
 * @author: ybhu
 * @create: 2024/01/31 11:51
 */
public class CompletableFuture2Demo {

    public static  void main(String[] args){


        CompletableFuture future1= CompletableFuture.supplyAsync(()->{
           System.out.println("执行第一个任务");
           return 0;
        }).thenRun(()->{

            System.out.println("执行第二个任务");
        }).thenRun(()->{
            System.out.println("执行第三个任务");
        });

    }

}
